﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using AskiNowclass;
using System.Data;
using System.Configuration;
using System.Text.RegularExpressions;

public partial class index : System.Web.UI.Page
{
    protected DataTable dtindex;

    protected void Page_Load(object sender, EventArgs e)
    {
        WebHelper.PageNoCache();

        string strUserAgent = Request.UserAgent.ToString().ToLower();
        if (strUserAgent != null)
        {
            if (Request.Browser.IsMobileDevice == true || strUserAgent.Contains("iphone") ||
                strUserAgent.Contains("blackberry") || strUserAgent.Contains("mobile") ||
                strUserAgent.Contains("windows ce") || strUserAgent.Contains("opera mini") ||
                strUserAgent.Contains("palm"))
            {
                Response.Redirect("/mobile");
            }
        }


        dtindex = SqlHelper.Table("select top 3  * from publish order by orderby");
    }

    ///// <summary>
    ///// 是否手机上网
    ///// </summary>
    ///// <returns></returns>
    //public static bool IsMobile()
    //{
    //    string m = "nokia|sony|ericsson|mot|samsung|sgh|lg|sie|philips|panasonic|alcatel|lenovo|cldc|midp|wap|mobile";
    //    string ua = HttpContext.Current.Request.UserAgent;
    //    if (Regex.IsMatch(ua, m, RegexOptions.IgnoreCase))
    //        return true;
    //    else
    //        return false;
    //}
}